package com.woniu.darryringmall.front.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniu.darryringmall.front.entity.Goods;
import com.woniu.darryringmall.front.entity.History;
import com.woniu.darryringmall.front.entity.HistoryGoods;
import com.woniu.darryringmall.front.mapper.HistoryMapper;
import com.woniu.darryringmall.front.service.HistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HistoryServiceImpl extends ServiceImpl<HistoryMapper, History> implements HistoryService {
    @Autowired
    private HistoryMapper historyMapper;

    @Override
    public void add(History history) {
        historyMapper.insert(history);
    }

    @Override
    public void delete(int id) {
        historyMapper.deleteById(id);
    }

    @Override
    public List<HistoryGoods> getHistoryByUserId(int userId) {
        return historyMapper.getHistoryByUserId(userId);
    }

}
